<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAHy-4chTxWi7fRAXj5xfkGRTuvTg5PsYyU7sA2ihJ2L73JhN5hhSRXNYnVkt16szDhN4ri_v5nyt4Mg"></script>
<script type="text/javascript" src="{$url}public/js/googleMap.js"></script>
<script type="text/javascript" src="{$url}public/js/service.js"></script>
{literal}
<script type="text/javascript">
    setMarker = false;
    $(document).ready(function(){
        startMap();
        service.setMarkers();
        service.setSite();
        service.startSlider();
        
        $('#searchCity').click(function(){
            service.setCity();
        });

        $('#markerButton').click(function(){
            service.addNewMarkerToMap();
        });

        $('#includeCompanyData').click(function(){
            $('.companyData').toggle();
        });
        $('#category').change(function(ev){
            service.getChildCategories(ev, this);
        });
        $("#backCategory").click(function(){
            service.backToParentCategory();
        });
       // $("#distance").change(function(){
          //  service.giveDistance($('#distance').val());
        //});
        $('.hideError').hide();
        //new logic of categories
        $('#categorySelectOne').change(function(ev){
            service.loadCategoriesToSecBox(ev, this);
        });
        $('#categorySelectSec').change(function(ev){
            service.loadCategoriesToThirdBox(ev, this);
        });
        $('#categorySelectThird').change(function(ev){
            service.nextCategories(ev, this);
        });
    });
</script>
{/literal}
<div id="dodajMainContent">
        <h1>Dodaj ofertę</h1>

        <form id="addServiceForm" method="post" action="{$url}zaproponuj-usługi/2">
                <input type="hidden" name="lon" id="mainLon" value="52.228220003460486">
                <input type="hidden" name="lat" id="mainLat" value="21.011524200439453">
                <ul id="offer1" class="one_offer">
                        <li>
                            <!--<input id="markerButton" type="button" class="add_new_point" value=""/>-->
                            <table class="mb-20">
                                 <tr>
                                     <td class="cityLabel">Miasto</td>
                                     <td><input class="inputStyle" id="city" name="city" /></td>
                                     <td><input class="buttonActionMain" type="button" name="searchCity" id="searchCity" value="Szukaj" /></td>
                                     <td>
                                         <div id="sliderContainer" style="position: relative;">
                                             <p class="distancePar">
                                                <label for="distance">Zasięg prac:</label>
                                                <input type="text" name="distance" id="distance" style="border:0; color:gray; font-weight:bold;" />
                                            </p>
                                            <div id="sliderDistance"></div>
                                         </div>
                                     </td>
                                 </tr>
                            </table>

                             

                            <div class="map" id="map"></div>
                        </li>
                        <li class="border" id="serviceNameLi">
                                <h2>Nazwa oferty&nbsp;*</h2>

                                <input id="serviceName" class="text clear {if !empty($message.form.serviceName)}redError{/if}" type="text" name="serviceName" value="{$filtr.serviceName}" />
                        </li>
                        <li class="categoryLi">
                            <h2>Kategoria&nbsp;*</h2>
                            <div class="categoryBox" id="categoryBoxOne">
                                <select size="5"  name="categorySelectOne" id="categorySelectOne" >
                                    {foreach from="$mainCategories" item=value}
                                            <option {if $value.id == $filtr.category} selected="selected" {/if}
                                                value="{$value.id}">{$value.name}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <div class="categoryBox" id="categoryBoxSec">
                                <select size="5"  name="categorySelectSec" id="categorySelectSec">
                                </select>
                            </div>
                            <div class="categoryBox" id="categoryBoxThird">
                                <select size="5"  name="categorySelectThird" id="categorySelectThird">
                                </select>
                            </div>
                        </li>
                        <li class="border">
                                <h2>Cena za całą usługę&nbsp;*</h2>

                                <input id="dodaj_adres" class="text clear {if !empty($message.form.pricePerService)}redError{/if}" type="text" name="pricePerService" value="{$filtr.pricePerService}" />
                        </li>
                        <li class="border">
                                <h2>Cena za godzinę&nbsp;*</h2>

                                <input id="dodaj_adres" class="text clear {if !empty($message.form.pricePerHour)}redError{/if}" type="text" name="pricePerHour" value="{$filtr.pricePerHour}" />
                        </li>
                        <li class="borderOneElement">
                                <h2>Opis oferty</h2>

                                <textarea id="dodaj_opis1" class="clear dodaj_opis {if !empty($message.form.description)}redError{/if}" type="text" name="description">{$filtr.description}</textarea>
                        </li>
                        <li class="border noBorder">
                                <h2>Imię&nbsp;*</h2>
                                <input class="text clear {if !empty($message.form.name)}redError{/if}" type="text" name="name" value="{$filtr.name}" />
                        </li>
                        <li class="border noBorder">
                                <h2>Nazwisko&nbsp;*</h2>
                                <input class="text clear {if !empty($message.form.surname)}redError{/if}" type="text" name="surname" value="{$filtr.surname}" />
                        </li>
                        <li class="borderOneElement">
                                <h2>Email&nbsp;*</h2>

                                <input id="dodaj_tytul" class="text clear {if !empty($message.form.email)}redError{/if}" type="text" name="email" value="{$filtr.email}" />
                        </li>

                        
<!--                        <li class="border" style="height: 59px;">
                            <h2></h2>
                        </li>-->
                        
                       <!-- <li>
                            
                        </li>-->
                        <li class="borderOneElement">
                            <div id="checkComapnyDataContainer">
                                <div id="companyButton">
                                    <input type="checkbox" id="includeCompanyData" name="includeCompanyData" {if $filtr.includeCompanyData }checked="checked" {/if} />
                                </div>
                                <div id="companyLabel"><h2>Firma</h2></div>
                            </div>
                            <div class="companyData" {if not $filtr.includeCompanyData}style="display: none;" {/if}>
                                <h2>Nazwa firmy&nbsp;*</h2>
                                <input id="companyName" class="text clear {if !empty($message.form.companyName)}redError{/if}" type="text" name="companyName" value="{$filtr.companyName}" />
                                
                            </div>
                        </li>
                        <li class="borderOneElement">
                            <h2>* - Pola wymagane</h2>
                        </li>
                        <!--<li class="border companyData" {if not $filtr.includeCompanyData }style="display: none; width: 452px;" {/if}>
                                <input id="nip" class="text clear" type="hidden" name="nip" value="{$filtr.nip}" />
                        </li>
                        <li class="last">
                        </li>-->
                </ul>

            <input type="hidden" value="{$site_address}" id="siteAddress" name="site_address" />
            <input class="inputStyle" id="addServiceButton" type="submit" value="" />
        </form>

</div>